const LOWER: i32 = 1;
const UPPER: i32 = 1000;

// Because the rule for our series is simply adding one, the number of terms are the number of
// digits between LOWER and UPPER
fn invsqr(n: f64) -> f64{
    1.0 / (n * n)
}
fn main() {
    // Naive method
    println!("{:16.14}", (LOWER..UPPER + 1).fold(0.0, |sum, x| sum as f64 + invsqr(x as f64)));
}
